/**
 * 判断是否为服务端渲染
 *
 * @returns {boolean} true 为服务端渲染，false 不为服务端渲染
 */
export const isSSR = (): boolean => {
  const importMeta = import.meta as ImportMeta & { env: Record<string, any> }
  return Boolean(
    importMeta?.env?.SSR ||
      importMeta?.env?.SSG ||
      importMeta?.env?.VITE_SSR ||
      importMeta?.env?.VITE_SSG
  )
}

export type IsSSRType = typeof isSSR
